{if $addNew}
<h1>Edytujesz opis punktu</h1>
<form method="post">
	<input type="hidden" name="confirmAdd" value="1" />
	<input type="hidden" name="x" value="{$x}" />
	<input type="hidden" name="y" value="{$y}" />
	<input type="hidden" name="w" value="{$w}" />
	<input type="hidden" name="h" value="{$h}" />
{mainoptions title="Dodaj opis"}

	<table cellspacing="0" cellpadding="0" border="0" class="commonTable" >
		<tr>
			<th>Obraz:</th>
			<td >
				<div style="background: url({$urlStatic}/{image w=800 src=$obj->getMainImage()}) no-repeat {math equation="-x+200" x=$x}px {math equation="-x+100" x=$y}px; height: 200px; width: 400px; border: 1px solid black;">
					<img src="{$urlStatic}/image/Admin/viewfinder.png" style="margin: 75px 175px;" />
				</div>
			</td>
		</tr>
		<tr>
			<th>Aktywny:</th>
			<td>
				<input type="radio" checked="checked" value="1" id="active_1" name="active" /><label for="active_1">tak</label>
				<input type="radio" value="1" id="active_0"  name="active"  /><label for="active_0">nie</label>
			</td>
		</tr>
	</table>

{/mainoptions}
{mainoptions title="Dane dla poszczególnych wersji językowych"}
	{assign var=class value=colapse}
	{foreach from=$languages item=lang}
	{capture assign=title}Dane języka: {$lang->getName()}{/capture}
	{mainoptions title=$title class=$class}
	<table cellpadding="0" cellspacing="0" width="100%" class="commonTable">
		<tr>
			<th>Nazwa</th>
			<td><input type="text" class="{if !isset($required)}required{/if}" name="name[{$lang->getId()}]" /></td>
		</tr>
		<tr>
			<th>Opis</th>
			<td>{capture assign=desc}description_{$lang->getId()}{/capture}{insertFckEditor name=$desc}</td>
		</tr>
	</table>
	{/mainoptions}
	{assign var=class value=expand}
	{assign var=required value=1}
	{/foreach}
{/mainoptions}
{mainoptions}
	<input type="submit" value="Zapisz" />
	<input type="button" value="Anuluj" onclick="window.location.reload();" />
{/mainoptions}
	</form>
{else}
<h1>Edytujesz info punkty</h1>
{mainoptions title="Lista zdefiniowanych"}
		<table cellspacing="0" cellpadding="0" border="0">
			<tr>
				<td>{tables label="Lp. [id]" tid=infopts_table o=id}</td>
				<td class="noSort">Punkt</td>
				<td >{tables label="Tytuł" tid=infopts_table o=name}</td>
				<td class="noSort"></td>

			</tr>
			{foreach from=$list item=item name=infopts_table}
			<tr>
				<td>{tables type='lp' tid='infopts_table' iteration=$smarty.foreach.infopts_table.iteration} [{$item->getId()}]</td>
				<td>
					<div style="background: url({$urlStatic}/{image w=800 src=$obj->getMainImage()}) no-repeat {math equation="-x+100" x=$item->getX()}px {math equation="-x+50" x=$item->getY()}px; height: 100px; width: 200px; border: 1px solid black;">
						<img src="{$urlStatic}/image/Admin/viewfinder.png" style="margin: 25px 75px;" />
					</div>
				</td>
				<td><p><b>{$item->getTitle()}</b><br />{$item->getDescriptionTxt()}</p></td>
				<td>
					<a href="{url product=infoptsedit id=$item->getId()}" class="edit"> edytuj</a>
					<a onclick="if(!confirm('Czy na pewno chcesz usunąć ten element?'))return false;" href="{url product=infoptsremove id=$item->getId()}" class="delete"> usuń</a>
				</td>
			</tr>
			{/foreach}
			<tr class="selAllRow">
				<td colspan="2">
					<div class="pager">
						{tables type='pagination' tid='infopts_table' all_count=$c}
						{tables type='on_page' tid='infopts_table'}
					</div>
				</td>
			</tr>
		</table>
{/mainoptions}
{mainoptions title="Dodaj nowy"}
<p style="margin: 5px;">
	wybierz punkt: <br /><br />
	<img src="{$urlStatic}/{image src=$obj->getMainImage() w=800}" class="infopts" />
</p>
<form method="post" id="addPoint">
	<input type="hidden" name="x" id="infox" value="" />
	<input type="hidden" name="y" id="infoy" value="" />
	<input type="hidden" name="h" id="infoh" value="" />
	<input type="hidden" name="w" id="infow" value="" />
	<input type="hidden" name="addPoint" value="1" />
</form>
{/mainoptions}
{/if}
{mainoptions}
<input type=button onclick="document.location='{url product=index}'" value="Wróć" />
{/mainoptions}